package de.se2.sharebox.classes;

/**
 *
 * @author Gruppe 10
 *
 */
public class File extends SystemDataType implements Cloneable
{
	/**
	 * Konstruktor
	 *
	 * @param name -
	 *          Dateiname
	 * @param owner -
	 *          Besitzer
	 * @param size -
	 *          Groesse
	 */
	public File(String name, UserAccount owner, int size)
	{
		super(name, owner);
		this.setSize(size);
	}

	private int size;

	public void setSize(int size)
	{
		this.size = size;
	}

	public int getSize()
	{
		return size;
	}

	public boolean upload()
	{
		Log.getInstance().addEntry("File", "uploading File " + getName());
		return true;
	}

	public boolean download()
	{
		Log.getInstance().addEntry("File", "downloading File " + getName());
		return true;
	}

	public File clone()
	{
		File theClone = null;
		try
		{
			theClone = (File) super.clone();
		} catch (CloneNotSupportedException e)
		{
		}
		return theClone;
	}
}
